package com.hpu.tools;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class TimeTools {
	public static int timeTransfrom(String startTime){
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
		try {
			
			long start=sdf.parse(startTime).getTime();
			long end=new Date().getTime();
			long seconds=(end-start)/1000;
			long day=seconds/(24*3600);
			int week=(int) (Math.floor(day/7)+1);
			return week;
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return -1;
	}

}
